Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually check system as root layout for Android 10. Fix #11 #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Roboe
Copy link
Member

@Roboe Roboe commented Apr 7, 2020

[Hopefully fixes #11]

Android 10 devices don't set ro.build.system_root_image but behave like so.

Since we can't reliably check the Android version through ro.build.version.sdk until we locate the system partition, then we only can check that the /system/system directory exists.

To avoid easy mistakes, a more specific /system/system/build.prop check has been implemented.

TEST BUILDS: https://github.com/WeAreFairphone/flashable-zip_microG/releases/tag/2020-04-07

Please, report if these pre-releases work for your Android 10 devices or other previous versions, with or without A/B system-as-root partitions layout. Tested succesfully with a OnePlus 3 @ LOS 17.1 and a Fairphone 2 @ LOS 15.1.

Android 10 devices don't set `ro.build.system_root_image` but behave like so.

Since we can't reliably check the Android version through `ro.build.version.sdk` until we locate the system partition, then we only can check that the `/system/system` directory exists.

To avoid easy mistakes, a more specific `/system/system/build.prop` check has been implemented.
@Roboe Roboe changed the title Manually check system as root layout for Android 10 Manually check system as root layout for Android 10. Fix #11 Apr 7, 2020
Copy link
Member Author

@Roboe Roboe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As pointed by @CameronNemo in #11, some systems use a /system_root/system path, not /system/system (their device runs LOS 17.1, Android 10)

This needs to be added to this PR (oops, can't request changes on my own PR, GitHub says)

@timotk
Copy link

timotk commented Aug 7, 2020

Hi @Roboe, I've been tinkering with this. Here's what I found:

Device: Xiaomi Redmi Note 7 (lavender)
OS: LineageOS 17.1 official

At first I got the following error when installing the UnifiedNLP-2020-04-07.zip: updater process ended with error: 1

Based on what I read in #11, I modified the zip:

  1. The initial SYSTEM_ROOT value needs to be /system_root and not system.
  2. Update SYSTEM_ROOT to /system_root/system.
  3. Comment out the whole SYSTEM_AS_ROOT if statement (L38-L45 of your PR).
  4. Update the last line, umount /system, to umount /system_root.

Result:

  1. "UnifiedNLP Settings" shows up in Settings > Location.

  2. UnifiedNLP Self check:
    [x] Permission to access location
    [ ] System supports location provider
    [x] UnifiedNLP is registered in system
    [x] Location backend(s) set up
    [x] Network-based location enabled
    [ ] UnifiedNLP has known location
    [ ] UnifiedNLP provider location updates

  3. In OsmAnd, I can see my location without a GPS fix.

Update:
This does not seem to survive reboot. Looking at logcat, it seems that the location providers do not have the location access permission anymore. When denying them the permission and re-enabling them in UnifiedNLP, it works again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnifiedNlp not working on LineageOS 17.0 Beta
2 participants